const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')


module.exports = {

 module:{
  rules:[
   {
    test:/\.css$/i,
    use:["style-loader","css-loader"]
   },
   {
    test:/\.less$/i,
    use:["style-loader","css-loader","less-loader"]
   },
   {
    test:/\.(png|jpe?g|svg|git)$/i,
    type:'asset',
    generator: {
     filename:'image/[hash:20][ext]'
    }
   }
  ]
 },
 // 其他配置
 plugins:[
  new HtmlWebpackPlugin({
   template:'./public/index.html'
  })
 ],
 mode:'production',
 entry :'./src/main.js',
 output : {
  path:path.resolve(__dirname,'dist'),
  filename:'bundle.js'
 }
}